# name: Factor to number
# key: factor.to.number
# contributor : Shuguang Sun
# condition: (string= "S" ess-language)
# --
as.numeric(levels(${1:factor}))[$1]